home *** CD-ROM | disk | FTP | other *** search
/ Euroscene 2 / Euroscene 2.iso / USEFUL / DeliTracker130 / Developer / Developer.run / Examples / Fred.s < prev    next >
Encoding:
Text File  |  1992-09-23  |  2.8 KB  |  154 lines

  1.  
  2.     incdir    "Includes:"
  3.     include    "misc/DeliPlayer.i"
  4.  
  5. ;
  6. ;
  7.     SECTION Player,Code
  8. ;
  9. ;
  10.  
  11.     PLAYERHEADER PlayerTagArray
  12.  
  13.     dc.b '$VER: Fred player module V1.1 (30 Mar 92)',0
  14.     even
  15.  
  16. PlayerTagArray
  17.     dc.l    DTP_PlayerVersion,1
  18.     dc.l    DTP_PlayerName,PName
  19.     dc.l    DTP_Creator,CName
  20.     dc.l    DTP_Check2,Chk
  21.     dc.l    DTP_Interrupt,Int
  22.     dc.l    DTP_InitPlayer,InitPlay
  23.     dc.l    DTP_EndPlayer,EndPlay
  24.     dc.l    DTP_InitSound,InitSnd
  25.     dc.l    DTP_EndSound,RemSnd
  26.     dc.l    DTP_PrevSong,PrevSub
  27.     dc.l    DTP_NextSong,NextSub
  28.     dc.l    TAG_DONE
  29.  
  30. *-----------------------------------------------------------------------*
  31. ;
  32. ; Player/Creatorname und lokale Daten
  33.  
  34. PName    dc.b 'Fred',0
  35. CName    dc.b 'JC & Fred,',10
  36.     dc.b 'adapted by Delirium',0
  37.     even
  38. fr_data        dc.l 0
  39.  
  40. *-----------------------------------------------------------------------*
  41. ;
  42. ;Interrupt für Replay
  43.  
  44. Int
  45.     movem.l    d0-d7/a0-a6,-(sp)
  46.     move.l    fr_data(pc),a0
  47.     jsr    4(a0)                 ; DudelDiDum
  48.     movem.l    (sp)+,d0-d7/a0-a6
  49.     rts
  50.  
  51. *-----------------------------------------------------------------------*
  52. ;
  53. ; Testet auf Fred-Modul
  54.  
  55. Chk                        ; Fred ?
  56.     move.l    dtg_ChkData(a5),a0
  57.     moveq    #-1,d0                ; Modul nicht erkannt (default)
  58.     cmpi.w    #$4efa,$0(a0)
  59.     bne.s    ChkEnd
  60.     cmpi.w    #$4efa,$4(a0)
  61.     bne.s    ChkEnd
  62.     cmpi.w    #$4efa,$8(a0)
  63.     bne.s    ChkEnd
  64.     cmpi.w    #$4efa,$c(a0)
  65.     bne.s    ChkEnd
  66.     moveq    #0,d0                ; Modul erkannt
  67. ChkEnd
  68.     rts
  69.  
  70. *-----------------------------------------------------------------------*
  71.  
  72. ; Init Player
  73.  
  74. InitPlay
  75.     moveq    #0,d0
  76.     move.l    dtg_GetListData(a5),a0        ; Function
  77.     jsr    (a0)
  78.     move.l    a0,fr_data
  79.  
  80.     clr.w    dtg_SndNum(a5)            ; first Subsong
  81.  
  82.     move.l    dtg_AudioAlloc(a5),a0        ; Function
  83.     jsr    (a0)                ; returncode is already set !
  84.     rts
  85.  
  86. *-----------------------------------------------------------------------*
  87. ;
  88. ; End Player
  89.  
  90. EndPlay
  91.     move.l    dtg_AudioFree(a5),a0        ; Function
  92.     jsr    (a0)
  93.     rts
  94.  
  95. *-----------------------------------------------------------------------*
  96.  
  97. ; Init Sound
  98.  
  99. InitSnd
  100.     move.l    a5,-(sp)
  101.     moveq    #0,d0
  102.     move.w    dtg_SndNum(a5),d0        ; SoundNum
  103.     move.l    fr_data(pc),a0
  104.     jsr    (a0)                ; Init Sound
  105.     move.l    (sp)+,a5
  106.     rts
  107.  
  108. *-----------------------------------------------------------------------*
  109. ;
  110. ; Remove Sound
  111.  
  112. RemSnd
  113.     move.l    a5,-(sp)
  114.     moveq    #0,d1
  115.     move.l    fr_data(pc),a0
  116.     jsr    8(a0)                ; End Sound
  117.     move.l    (sp)+,a5
  118.     rts
  119.  
  120. *-----------------------------------------------------------------------*
  121. ;
  122. ; Previous SubSong
  123.  
  124. PrevSub
  125.     tst.w    dtg_SndNum(a5)
  126.     beq.s    PrevSubEnd
  127.     move.l    dtg_StopInt(a5),a0
  128.     jsr    (a0)
  129.     bsr    RemSnd
  130.     subq.w    #1,dtg_SndNum(a5)        ; Vorheriger Sound
  131.     bsr    InitSnd
  132.     move.l    dtg_StartInt(a5),a0
  133.     jsr    (a0)
  134. PrevSubEnd
  135.     rts
  136.     
  137. *-----------------------------------------------------------------------*
  138. ;
  139. ; Next SubSong
  140.  
  141. NextSub
  142.     move.l    dtg_StopInt(a5),a0
  143.     jsr    (a0)
  144.     bsr    RemSnd
  145.     addq.w    #1,dtg_SndNum(a5)        ; Nächster Sound
  146.     bsr    InitSnd
  147.     move.l    dtg_StartInt(a5),a0
  148.     jsr    (a0)
  149. NextSubEnd
  150.     rts
  151.  
  152. *-----------------------------------------------------------------------*
  153.  
  154.